#include "task_queue.h"
int taskEnQueue(taskQueue_t *pQueue, int netfd,struct sockaddr_in* netaddr){
    // 尾插法
    task_t * pNew = (task_t *)calloc(1,sizeof(task_t));
    pQueue->pRear->netfd=netfd;
    pQueue->pRear->netaddr=netaddr;
    pQueue->pRear->pNext=pNew;
    pQueue->pRear=pNew;
    pQueue->queueSize++;
    return 0;
}
int taskDeQueue(taskQueue_t *pQueue){
    // 头部删除法
    if(pQueue->queueSize==0)return 0;
    task_t *pCur = pQueue->pFront->pNext;
    pQueue->pFront->pNext = pCur->pNext;
    free(pCur);
    pQueue->queueSize--;
    return 0;
}
